/**
 * Copyright (c) Software Institude of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.modeler.model.uml.IntermediateActions;
// imports:
import org.w3c.dom.Element;

import edu.pku.sei.gefcommon.descriptor.annotation.MethodProperty;
import edu.pku.sei.modeler.model.common.*;
import edu.pku.sei.modeler.model.core.*;
import edu.pku.sei.modeler.model.xml.XMLUtility;

import edu.pku.sei.modeler.model.uml.BasicActions.InputPin;
import edu.pku.sei.modeler.uml.modelHelper.ModelPackage;


/**
 * @generated
 *
 */
public class LinkEndDestructionData extends LinkEndData implements ILinkEndDestructionData {
	// attributes
	
	protected boolean isRemoveDuplicates;
	
	
	
	
	// references
	
	protected MetaTypedList destroyAt;
	
	
	
	// getters & setters for attributes
	
	@MethodProperty(
			id = "LINKENDDESTRUCTIONDATA_ISREMOVEDUPLICATES",
			catalog = "Model",
			name = ModelPackage.LINKENDDESTRUCTIONDATA_ISREMOVEDUPLICATES,
			setter = "setisRemoveDuplicates"
			)
	
	public boolean getIsRemoveDuplicates() {
		return isRemoveDuplicates;
	}
	public void setIsRemoveDuplicates(boolean newIsRemoveDuplicates) {
		boolean oldisRemoveDuplicates = isRemoveDuplicates;
		isRemoveDuplicates = newIsRemoveDuplicates;
		firePropertyChange(ModelPackage.LINKENDDESTRUCTIONDATA_ISREMOVEDUPLICATES, oldisRemoveDuplicates, newIsRemoveDuplicates);
	}
	
	// getters for references
	
	public MetaTypedList getDestroyAt() {
		if(destroyAt == null) {
			destroyAt = new MetaTypedList(InputPin.class, this, ModelPackage.LINKENDDESTRUCTIONDATA_DESTROYAT);
		}
		return destroyAt;
	}
	
	// save & load
	public void serialize(Element root) {
		super.serialize(root);
		// attributes
		
		XMLUtility.xmlInstance.serializeAttribute(root, ModelPackage.LINKENDDESTRUCTIONDATA_ISREMOVEDUPLICATES, isRemoveDuplicates);
		
		// references
		
		XMLUtility.xmlInstance.serializeNodesNotContain(root, ModelPackage.LINKENDDESTRUCTIONDATA_DESTROYAT, destroyAt);		
		
	}
	
	public void deSerialize(Element root) {
		super.deSerialize(root);
		// attributes
		
		isRemoveDuplicates = XMLUtility.xmlInstance.deSerializeBoolean(root, ModelPackage.LINKENDDESTRUCTIONDATA_ISREMOVEDUPLICATES);
		
		// references
		
		this.getDestroyAt().addAll(XMLUtility.xmlInstance.deSerializeNodesNotContain(root, ModelPackage.LINKENDDESTRUCTIONDATA_DESTROYAT, this));
		
	}
	
	public void dynamicSet(String featureID, Object value) {
		if(featureID == null || "".equals(featureID)) {
			return;
		}
		// attributes
		
		// references
		
		else if(ModelPackage.LINKENDDESTRUCTIONDATA_DESTROYAT.equals(featureID)) {
			getDestroyAt().add(value);
		}
		
		else
			super.dynamicSet(featureID, value);
	}
}
 
 
 
 
 